﻿<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Web报表(B/S报表)演示 - 用子报表实现表中表(AJAX方式)</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<script src="../../../CreateControl.js" type="text/javascript"></script>
	<script src="../../../GRUtility.js" type="text/javascript"></script>
	<script type="text/javascript">

//在网页初始加载时向报表提供数据
function window_onload() 
{
    //关联子报表部件框的报表对象
    var srByOrder = ReportViewer.Report.ControlByName("srByOrder").AsSubReport.Report;
    var srByCity = ReportViewer.Report.ControlByName("srByCity").AsSubReport.Report;
    
    //关联事件
    srByOrder.OnInitialize = OnOrderInitialize;
    srByCity.OnInitialize = OnCityInitialize;
    
	//开启报表生成进度条显示
	//ReportViewer.Report.ShowProgressUI = true;
	
    //启动运行
    //ReportViewer.Start();
    AjaxReportViewerStart(ReportViewer, "../../../06.SubReport/Obsolete/xmlSRGridInGrid.jsp");
}

function OnOrderInitialize()
{
	//将主报表的当前行的“OrderID”字段值作为子报表的取数参数
    var srByOrder = ReportViewer.Report.ControlByName("srByOrder").AsSubReport.Report;
    AjaxSyncLoadReportData(srByOrder, encodeURI("../../../06.SubReport/Obsolete/xmlSRGridInGrid1.jsp?OrderID=" + ReportViewer.Report.FieldByName("OrderID").AsInteger));
}

function OnCityInitialize()
{
	//将主报表的当前行的“ShipCity”字段值作为子报表的取数参数
    var srByCity = ReportViewer.Report.ControlByName("srByCity").AsSubReport.Report;
    AjaxSyncLoadReportData(srByCity, encodeURI("../../../06.SubReport/Obsolete/xmlSRGridInGrid2.jsp?City=" + ReportViewer.Report.FieldByName("ShipCity").AsString));
}
	</script>
    <style type="text/css">
        html,body {
            margin:0;
            height:100%;
        }
    </style>
</head>
<body style="margin:0" onload="window_onload()">
    <script type="text/javascript"> 
        CreatePrintViewerEx("100%", "100%", "../../../grf/4c.grf", "", false, "");
    </script>
</body>
</html>
 